﻿using FluentValidation;
using Mes.Application.DTO.Inputs.MasterData;

namespace Mes.Application.Web.Validators.MeasuringUnitValidators
{
    public class MeasuringUnitInputValidator : AbstractValidator<MeasuringUnitInput>
    {
        public MeasuringUnitInputValidator()
        {
            RuleFor(x => x.UnitName).NotEmpty().WithMessage("UnitName不能为空");
            RuleFor(x => x.UnitCode).NotEmpty().WithMessage("UnitCode不能为空");
            RuleFor(x => x.ConversionUnit).GreaterThanOrEqualTo(0).WithMessage("关联换算单位必须大于等于0");
        }
    }
}
